package basic_grammar

import (
	"fmt"
	"strconv"
)

func Convert2Bin(num int) string {
	var res string
	var lsb int
	for ; num > 0; num /= 2 {
		lsb = num % 2
		res = strconv.Itoa(lsb) + res
	}
	return res
}

var a *string

func TestSwitch() {
	a := 10.3

	switch a {
	case 10.3:
		fmt.Printf("这是10")
	case 100:
		fmt.Println("这是100")
	case 1000:
		fmt.Println("这是1000")
	default:
		fmt.Println("默认输出")

	}
}
